﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LogNet;
namespace Comm
{
    public static class Logger
    {
        private static readonly ILogNet PlcLogger = new LogNetDateTime("../PlcLog", GenerateMode.ByEveryDay);
        private static readonly ILogNet ScanLogger = new LogNetDateTime("../ScanLog", GenerateMode.ByEveryDay);
        private static readonly ILogNet SysLogger = new LogNetDateTime("../SysLog", GenerateMode.ByEveryDay);
        private static readonly ILogNet ResultLogger = new LogNetDateTime("../ResultLog", GenerateMode.ByEveryDay);
        public static void WritePlcLog(string msg)
        {
            PlcLogger.WriteDebug(msg);
        }
        public static void WriteSysLog(string msg)
        {
            PlcLogger.WriteDebug(msg);
        }
        public static void WriteScanLog(string msg)
        {
            PlcLogger.WriteDebug(msg);
        }
        public static void WriteResultLog(string msg)
        {
            ResultLogger.WriteDebug(msg);
        }
        public static void WritePlcLog(string msg, Exception ex)
        {
            PlcLogger.WriteException(msg, ex);
        }
        public static void WriteSysLog(string msg, Exception ex)
        {
            SysLogger.WriteException(msg, ex);
        }
        public static void WriteScanLog(string msg, Exception ex)
        {
            ScanLogger.WriteException(msg, ex);
        }
        public static void WriteResultLog(string msg, Exception ex)
        {
            ResultLogger.WriteException(msg, ex);
        }
    }
}
